Skip to content

Conversation

manerlan
Copy link
Member

Closes #78 .

Prettier failed on almost every file on Windows. The files in the repository use LF, but Git on Windows (core.autocrlf=true) turns them into CRLF in the working copy, and Prettier expects LF.

What

A new .gitattributes in the repository root:

* text=auto eol=lf

Git now uses LF in the working copy on every machine, whatever core.autocrlf is set to. Git still detects binary files, such as images, by itself.

No other files change: the repository already uses LF.

How it was tested

  • After refreshing the working copy, git status is clean
  • file frontend/src/test/setup.ts no longer reports CRLF
  • npm run format:check passes on Windows
  • npm run check

⚠️ After this is merged: everyone on Windows

Run this once, with a clean git status (commit or stash your work first, because reset --hard replaces the files in the working copy):

git pull
git rm -r --cached -q .
git reset --hard

This only fetches the same files again with LF. Branches you have pushed are not affected. Mac and Linux users do not need to do anything.

@manerlan manerlan requested a review from a team as a code owner November 17, 2026 19:21
@manerlan manerlan linked an issue Nov 17, 2026 that may be closed by this pull request
3 tasks
Copy link
Member

@williasc williasc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good. Tiny but useful change

@williasc williasc merged commit e7fc23c into main Nov 17, 2026
@williasc williasc deleted the 78-prettier-windows-fix branch November 17, 2026 20:53
@manerlan manerlan mentioned this pull request Nov 17, 2026
Sign in to join this conversation on GitHub.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Prettier fails on Windows because of CRLF line endings
2 participants